You've probably heard the word eigenvectors hundreds of times in class and have been asked to calculate it hundreds more. But why is this concept so central in Linear Algebra? Why is it that we study the eigenvector of a matrix so often?
In this post, we'll see how Eigenvectors help us immediately understand what a linear function will do to an input. We'll do so by playing with an interactive visualization that allows us to see just that.
Quick Refresher
Here, applying AA on its eigenvector vv leades to a new vector lambda v\lambda v is in the same direction as vv. Image Source: Wikipedia.
Let's do a quick refresher to begin with. The eigenvector of a linear function AA is just the vector vv s.t. Av=lambda vAv = \lambda v for some constant lambda\lambda which we call the eigenvalue. At a high level, the eigenvector is just a dimension along which the linear function only stretches its input (for real valued eigenvalues).
This is great and all but what can we do once we find an Eigenvector? What does it tell us about the underlying Matrix?
Linear Functions Pull Inputs Towards the Dominant Eigenvector
Let's start with an example. Take the following linear function:
Let's see what happens when we apply AA repeatedly on the input [[0],[1]]\begin{bmatrix} 0 \\ 1\end{bmatrix}.
{% comming soon!! %}
To play with this visualization, do the following:
Drag the slider to increase the number of times we apply AA.
Notice how the output vector tilts towards v_(1)v_1, an eigenvector of AA.
So just by knowing an eigenvector of AA (namely the dominant eigenvector), we can get a sense of what AA does - AApulls its input towards the axis of the dominant eigenvector.
How is this happening? And why is it only towards one eigenvector?
Breaking Up the Input With an Eigenbasis
You'll be surprised to see that this behavior comes very naturally from the properties of linear functions. Let's see this with an example.
Let's keep the same matrix/linear function A=[[3,2],[1,4]]A = \begin{bmatrix}3 & 2 \\ 1 & 4\end{bmatrix}, and analyze applying AA three times on the input v=[[0],[1]]v = \begin{bmatrix} 0 \\ 1 \end{bmatrix} (i.e. A^(3)vA^3v).
In the standard way, we'd just use standard matrix multiplication to find A^(3)v.A^3v.
The standard way to do this is to simply follow the rules of multiplication and carry out A(A(A(v))).A(A(A(v))). But instead, let's do this a different way using eigenvectors.
In the following discussion we will split vv into a linear combination of AA's eigenvectors. We then apply A^(3)A^3 to each of these pieces and combine the result.
We know that that any vector vv can be written as the sum of the eigenvectors of AA. After all, eigenvectors are linearly independent and form a basis for the space (if the matrix AA is diagonalizable, which it is). If v_(1)v_1 and v_(2)v_2 are the eigenvectors of A,A, we can break up vv as:
v=c_(1)*v_(1)+c_(2)*v_(2)v = c_1 \cdot v_1 + c_2 \cdot v_2 for some constants c_(1)c_1 and c_(2).c_2.
We first split vv into its eigenvector subcomponents.
When we have this representation, we can then rethink A^(3)vA^3v as:
Now, what happens when |lambda_(1)||\lambda_1| is larger than |lambda_(2)||\lambda_2| (i.e. there exists a dominant eigenvalue)? In this example, lambda_(1)=5\lambda_1 = 5 and lambda_(2)=2.\lambda_2 = 2. Let's now display what it would look like to carry out A^(3)vA^3v when we have this difference in eigenvalues.
The interaction below shows this setup:
{% include eigenvectors.html %}
Drag the slider to increase or decrease the number of times we apply AA on v.v.
Notice how "Output Eigenvector 1" and "Output Eigenvector 2" change at different rates.
Notice how "Final Output Vector" tilts towards "Output Eigenvector 1" as you drag the slider to the right.
We thus see that when there's one eigenvalue larger than the other (|lambda_(1)| > |lambda_(2)||\lambda_1| > |\lambda_2|), the linear function pushes its inputs towards the eigenvector associated with that large eigenvalue ("Output EigenVector One"). The more times we apply AA, the larger this effect.
Note this "push" effect will only happen towards this eigenvector with the largest eignevalue - not any of the other eigenvectors.
Why this happens
This tilt towards "Output Vector One" happens due to exponential growth. lambda_(1)^(x)\lambda_1^x grows much faster than lambda_(2)^(x)\lambda_2^x. As such the more times we apply AA (xx in our exponentials), the bigger the difference between lambda_(1)^(x)\lambda_1^x and lambda_(2)^(x).\lambda_2^x. Hence the v_(1)v_1 term has much more weight in the final sum. This increasing difference is shown in the plot below.
Due to the power of exponentials, the dominant eigenvector will play a bigger and bigger role the more times we apply A. Notice how the distance between the two expontial functions increases with x.
Conclusion
So, just using the properties of linear functions, we are able to see why eigenvectors are so important. They show us where a linear function will "push" its inputs.
If you've enjoyed this post on eigenvectors, check out the following additional posts on the topic I've written: